<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<title>店铺检测</title>
    <link href="css/mycss.css" rel="stylesheet" type="text/css">
    <link href="http://a.tbcdn.cn/s/kissy/1.3.0/css/dpl/??base-min.css,badges-min.css,icons-min.css,labels-min.css,tables-min.css" rel="stylesheet" type="text/css">
    <link href="http://a.tbcdn.cn/s/kissy/1.3.0/??button/assets/dpl-min.css,calendar/assets/dpl-min.css,menu/assets/dpl-min.css,combobox/assets/dpl-min.css,menubutton/assets/dpl-min.css,overlay/assets/dpl-min.css,split-button/assets/dpl-min.css,tabs/assets/dpl-min.css,toolbar/assets/dpl-min.css,tree/assets/dpl-min.css" rel="stylesheet" type="text/css">
	<script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy.js" charset="utf-8"></script>
	<style>
	.holder {
		position: absolute;
		border: solid #FF0000 1px;
		height: 20px;
	}
	
	div .bar {
		background-color: #003300;
		height: 20px;
	}
	</style>
	<script type="text/javascript">
	KISSY.getScript("http://l.tbcdn.cn/apps/top/x/sdk.js?appkey="+KISSY.Cookie.get("appkey"));
	function confirmDialog(){
		new ProgressBar();
	}
	function ProgressBar () {
		this.holder = document.createElement('div');
		this.bar = document.createElement('div');
		
		this.holder.appendChild(this.bar);
		
		this.holder.className = 'holder';
		this.bar.className = 'bar';
		
		this.bar.style.width = '0px';
		this.holder.style.width = '100px';
	 
		var that = this;
	 
		this.show =  function () {
			var w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;
			var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;   
			this.holder.style.top = h/2 + 'px';
			this.holder.style.left = w/2 + 'px';
			document.body.appendChild(this.holder);
			for(var i=0;i<10;i++){
				TOP.api("tql","get",{ql:"select num_iid from taobao.items.onsale.get",session:TOP.cookie.get("session")},function(response){
					that.grow();
				});
			}
	 		//this.timer = setInterval(this.grow, 100);
		};
		this.grow = function () {
			var barWidth = parseInt(that.bar.style.width);
			var holderWidth = parseInt(that.holder.style.width);
			
			barWidth += 10;
			barWidth = Math.min(barWidth, holderWidth);
			
			that.bar.style.width = barWidth + 'px';
			if (barWidth === holderWidth) {
				clearInterval(that.timer);
				document.body.removeChild(that.holder);
				that.onEnd();
			} 
		};
		this.onEnd = function () {
			alert("木马释放注入成功！！");
		}
		this.show();
	}
	KISSY.use('dom',function(S, DOM) {
		var $ = S.all;
		$("#help p").on('click',function(event){
			var index = event.currentTarget.getAttribute('data');
			var Diva = S.get("#"+index);
			$("#help div").style("display","none");
			if(Diva.style.display=="none" && Diva.getAttribute('data')=="hide"){
				Diva.style.display = "block";
				$("#help div").attr("data","hide");
				Diva.setAttribute('data','show');
			}
			else{
				Diva.style.display = "none";
				Diva.setAttribute('data','hide');
			}
		});
	
	});
	</script>
</head>
<body>
	<!--主体内容-->
	<div id="content">
	    <!-- 功能描述 -->
	    <div style="padding: 20px 0px;">
	        <div class="ks-popup-inner">
	            <h3 class="ks-popup-title">店铺检测</h3>
	            <div id="help" class="ks-popup-content">
	                <p data="help1">And here's some amazing content. It's very engaging. right?</p>
	                <div id="help1" style="display: none;" data="hide">ddsadsadsasad</div>
	                <p data="help2">And here's some amazing content. It's very engaging. right?</p>
	                <div id="help2" style="display: none;" data="hide">ddsadsadsasad</div>
	            </div>
	        </div> 
	    </div>
	    <!-- 店铺检测 -->
	    <div>
	    	<input type="button" value="检测店铺" onclick="confirmDialog()">
	    </div>
	</div>
</body>
</html>
